<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.grep.extra.dao.impl.WebSiteDAOSQL,com.grep.base.util.PinYin4jUtil,com.grep.base.util.UUIDGenerator"%>
<%
//添加网站站点
WebSiteDAOSQL webSiteDAOSQL = new WebSiteDAOSQL();

request.setCharacterEncoding("UTF-8");
String id = UUIDGenerator.getUUID();
String siteName = request.getParameter("sitename");
String siteUrl = request.getParameter("siteurl");
String siteLogo = request.getParameter("sitelogo");
String siteDesc = request.getParameter("sitedesc");
if (siteName != null) {
	String siteEnname = PinYin4jUtil.getPinyin(siteName);

	String inserSitetSql = "insert into web_site(id,site_name,site_url,site_logo,site_desc,site_enname) values('"
			+ id
			+ "','"
			+ siteName
			+ "','"
			+ siteUrl
			+ "','"
			+ siteLogo + "','" + siteDesc + "','" + siteEnname + "')";
	boolean issuccess = webSiteDAOSQL.insertWebSite(inserSitetSql);
	
	if(issuccess){
		response.getWriter().println("添加成功");	
	}else{
		response.getWriter().println("添加失败");
	}

}

%>